package com.pinyoumei.app.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.pinyoumei.app.R;
import com.pinyoumei.app.bean.ExchangeFreeListBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2021-06-26.
 * --------- 日期 ------- 维护人 ------------ 变更内容 --------
 * 2021-06-26        Administrator             新增Person类
 * 2021-06-26        Administrator             增加sex属性
 */
public class ExChangeCouponAdapter extends BaseQuickAdapter<ExchangeFreeListBean.ResultBean.ExchangeCouponListBean, BaseViewHolder> {
    public ExChangeCouponAdapter(int layoutResId, @Nullable List<ExchangeFreeListBean.ResultBean.ExchangeCouponListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ExchangeFreeListBean.ResultBean.ExchangeCouponListBean item) {
        ImageView rl_bg = helper.getView(R.id.rl_bg);
        rl_bg.setImageResource(R.mipmap.ic_coupon_bg_1);

        helper.setText(R.id.tv_coupon_amount,item.getCoupon_amount()+"元");

        helper.setText(R.id.tv_type, "类型：" + item.getCoupon_type());

        helper.setText(R.id.tv_coupon_title, "所需积分：" + item.getNeed_score());

        helper.setText(R.id.tv_use_condition, "适用于：" + item.getUse_condition()+"");

        helper.setText(R.id.tv_expire_time, "有效期：" + item.getExpire_time()+"");

    }
}
